-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client-side violations for money request updates #34402
Client-side violations for money request updates #34402
Conversation
Update everywhere that accesses an arg on policy to use {} as default arg for safety, since we can't use optional chaining
…money-request-updates
…saction violations. Fix and make that more clear with argument names
6ad58a5
to
f2942ea
Compare
@parasharrajat Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
…money-request-updates
@parasharrajat Hi, are you going to be able to review this PR soon? |
@lindboe Please merge main. Reviewing it now. |
@parasharrajat Looks like a significant change from upstream -- the Fixing conflicts now... |
…money-request-updates
This reverts commit 3493040.
58d9c3d
to
fbbcdae
Compare
Okay, so that this can move forward, I'm aiming for minimal changes:
Going to run through some test cases and make sure it's all good now. |
Okay @parasharrajat this should be good to go again, except the perf-tests that appear to be failing on main as well. Should have a message for open-source about the broken policy tags types in a little while. |
Asked about policyTags types here: https://expensify.slack.com/archives/C01GTK53T8Q/p1707263531033829 |
Thanks, I was going to suggest what you already did (to ignore the type errors for now, since the more we add to this PR the harder it'll get to get it merged) |
Another day, another refactor update: the command to update description now lives in its own component. Updated. @cead22 while testing this update, I noticed an assumption in earlier decisions doesn't seem to be true: in a few places, we're checking if
I'm assuming |
Above issue with @parasharrajat tests are passing again. Just to clarify, next steps were for you to test this out again right? |
Screenshots🔲 iOS / nativeScreen.Recording.2024-02-09.at.2.51.16.PM.mov🔲 iOS / SafariScreen.Recording.2024-02-09.at.2.31.25.PM.mov🔲 MacOS / DesktopScreen.Recording.2024-02-09.at.2.25.42.PM.mov🔲 MacOS / ChromeScreen.Recording.2024-02-09.at.1.01.29.PM.mov🔲 Android / ChromeScreen.Recording.2024-02-09.at.2.34.42.PM.mov🔲 Android / nativeScreen.Recording.2024-02-09.at.2.50.14.PM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. There are couple of prop warnings but I think those will be removed when these components are migrated to TS.
I will also report some to Slack in sometime.
…money-request-updates
Co-authored-by: Carlos Alvarez <cead22@gmail.com>
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/cead22 in version: 1.4.40-0 🚀
|
Noting here that QA did not really validate this PR as the QA steps were not clear enough for them it seems like. I believe its fine not to block deploy on this and we will internally test these and report any issues as we find them |
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.40-5 🚀
|
@@ -1210,78 +1218,153 @@ function getUpdateMoneyRequestParams( | |||
}); | |||
} | |||
|
|||
if (policy?.id && updatedTransaction) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This incomplete condition caused #43767.
We should have also checked whether transactionChanges
are made either for category
or tag
and not execute this check for every change in the transaction
Details
Adds optimistic client-side updates for money requests for missing tags, categories, or disabled tags/categories. This PR handles edits, while #32528 handled creation of money requests. Requires setting up a policy in old dot and configuring it to have a workspace (see testing instructions). This PR does not make any visible changes; that is scoped to other tickets.
Fixed Issues
$ #31093
PROPOSAL:
Tests
Setup:
Instructions for all tests
Expectations for violations, generally:
Testing the violations were stored correctly (web only):
ONYXDB
->keyvaluepairs
within your browser storage tabtransactions_someID
. If you open chrome dev tools before making the money request, you can inspect the response which should have the transactionIDtransactionViolations_SameIDasTransaction
, with the array content specified by the testTest no client-side violations
transactionViolations_ID
key, or, if you've navigated to edit the request, you may see a transaction violations list with only acashExpenseWithNoReceipt
violation.cashExpenseWithNoReceipt
violation.Test missing tag
transactionViolations_ID
key, with an array containing amissingTag
violation, and possibly also acashExpenseWithNoReceipt
violation.transactionViolations_ID
key, or, if you've navigated to edit the request, you may see a transaction violations list with only acashExpenseWithNoReceipt
violation.Test missing category
transactionViolations_ID
key, with an array containing amissingCategory
violation, and possibly also acashExpenseWithNoReceipt
violation.transactionViolations_ID
key, or, if you've navigated to edit the request, you may see a transaction violations list with only acashExpenseWithNoReceipt
violation, or no violations.Test tag out of policy
tagOutOfPolicy
violation is shown in the transaction violations list.tagOutOfPolicy
is no longer in the transaction violations list.Test category out of policy
categoryOutOfPolicy
violation is shown in the transaction violations list.categoryOutOfPolicy
is no longer in the transaction violations list.Offline tests
Repeat the tests outlined above while completely offline, except for "tag/category out of policy", because you can't change policy while offline. Different steps for those tests are provided below.
Then, in addition, after each test, go online and verify the transactionViolations key remains the same, with the potential addition of a
cashExpenseWithNoReceipt
violation, or no violations.Test tag out of policy (offline)
tagOutOfPolicy
violation is shown in the transaction violations list.tagOutOfPolicy
violation.Test category out of policy (offline)
categoryOutOfPolicy
violation is shown in the transaction violations list.categoryOutOfPolicy
violation.Test failure to edit request (web only, requires Chrome)
transactionViolations_
key to ensure there is acategoryOutOfPolicy
violation there.api?command=EditMoneyRequest
(it is possible that instead it might be a more specific command in the future, likeUpdateMoneyRequestTag
). Right-click and select "Block request URL". This will cause subsequent calls to this URL to fail.categoryOutOfPolicy
violation should be gone.categoryOutOfPolicy
violation).categoryOutOfPolicy
violation.QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Tag out of policy tests
Category out of policy tests
Failure data tests
MacOS: Desktop